/**
* Copyright (c) 2013-2014, qtone Inc. All Rights Reserved.
*
* @author: tanghuaicheng
* Project Name: testuc
* $Id:   2017-01-11 10:54:07 $
*/
package com.bangcommunity.bbframe.common.base;

import java.io.Serializable;

public class BaseZsetBean<E extends Serializable> implements Serializable {

    /**
    *
    */
    private static final long serialVersionUID = 1L;

    private String key;// 用户ID
    private E bean;//
    private double score;// 排序依据

    public BaseZsetBean(String key, E bean, double score) {
        this.key = key;
        this.bean = bean;
        this.score = score;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o)
            return true;
        if (o == null || getClass() != o.getClass())
            return false;

        BaseZsetBean<?> that = (BaseZsetBean<?>) o;

        return !(key != null ? !key.equals(that.key) : that.key != null);

    }

    public String getKey() {
        return this.key;
    }

    public E getBean() {
        return this.bean;
    }

    public double getScore() {
        return this.score;
    }

    @Override
    public int hashCode() {
        return key != null ? key.hashCode() : 0;
    }
}